﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class judgemanage : System.Web.UI.Page
{
    public string SqlClass = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"]==null)
		{
			Response.Write("<script>alert('你没有管理员权限，禁止访问！');history.back();</script>");
		}
		AspNetPager1.RecordCount = (int)Socut.Data.ExecuteScalar("select count(*) from web_judge");
		ShowData();
    }
    private void ShowData()
    {
        DataSet ds = Socut.Data.ExecuteDataSet("select * from web_judge order by orderno",AspNetPager1.PageSize*(AspNetPager1.CurrentPageIndex-1),AspNetPager1.PageSize);
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        ShowData();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string ids = Request.Form["Ccheck"];
        if (string.IsNullOrEmpty(ids))
        {
            CommonFunction.ShowMessage("请选择要删除的项");
        }
        else
        {
            Socut.Data.ExecuteNonQuery("DELETE from web_judge where id in (" + ids + ")");
            CommonFunction.ShowMessage("删除成功","judgemanage.aspx");
        }
    }
	
	public string checkisshow(string str)
	{
		string strstatus="";
		if (str=="0")
		{
			strstatus="可用";
		}
		else if (str=="1")
		{
			strstatus="<font color='#ff6600'>不可用</font>";
		}
		return strstatus;
	}
}
